#include<bits/stdc++.h>
#define ll long long
#define for1(i,a,b) for(ll i=a;i<=b;i++)
using namespace std;
inline ll re()
{
    ll s=0,f=1; char c=getchar();
    while(!isdigit(c)) {if(c=='-')f=-1;c=getchar();}
    while(isdigit(c)) {s=s*10+c-'0';c=getchar();}
    return f*s;
}
inline void wr(ll x)
{
    if(x<0) {putchar('-');wr(-x);return;}
    if(x>9) wr(x/10);
    putchar(x%10+'0');
}
const ll N=1e5+10;
ll n,a[N];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout); 
    n=re();
    for1(i,1,n) a[i]=re();
    sort(a+1,a+n+1);
    ll j=1;
    for1(i,2,n) if(a[i]>a[j]) j++;
    wr(n-j+1); putchar('\n');
    return 0;
}
/*
10
136 136 136 2417 136 136 2417 136 136 136
*/